package aiku.numericalcontroloa;

import aiku.numericalcontroloa.Base.Utils.Result;
import aiku.numericalcontroloa.Mapper.UserMapper;
import aiku.numericalcontroloa.Model.Entity.User;
import aiku.numericalcontroloa.Service.DieOrderService;
import cn.dev33.satoken.secure.SaSecureUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext;

@SpringBootTest
public class NumericalControlOaTestApplication {

    @Autowired
    private UserMapper userMapper;

    @Autowired
    private DieOrderService dieOrderService;

    @Test
    void test() {
        String userId = "13bfab443becf0ada102e7c6342d70f6";
        String salt = "b819e0ac";
        String ciphertext = SaSecureUtil.aesEncrypt(salt, "123456");
        User user = userMapper.selectById(userId);
        user.setPassword(ciphertext);
        userMapper.updateById(user);
    }

    @Test
    void test2() {
        Result statistics = dieOrderService.getIncomeRanking("2024");
        System.out.println(statistics);
    }

}
